#pragma once

// -----------------------------------------------------------------------------

#include <Windows.h>
#include <Winbase.h>

#include "Win32.Diagnostics.Result.h"
#include "Win32.String.h"

namespace Kif
{
namespace Win32
{
namespace IO
{

class Directory
{
private:
   Kif::Win32::Diagnostics::Result lastResult;
public:

   Directory()
   {
      lastResult.Clear();
   }  // end of File (ctor)

   // --------------------------------------------------------------------------

   static inline DWORD setCurrentDirectory(TCHAR *newDirectoryPath)
   {
      if (!::SetCurrentDirectory(newDirectoryPath))
         return(GetLastError());
      return(ERROR_SUCCESS);
   }  // end of SetCurrentDirectory

   inline bool SetCurrentDirectory(TCHAR *newDirectoryPath)
   {
      lastResult.Clear();
      lastResult.ErrorNo = setCurrentDirectory(newDirectoryPath);
      return(lastResult.ErrorNo == ERROR_SUCCESS);
   }  // end of SetCurrentDirectory

}  ;  // end of Directory class

}  // end of Kif::Win32::IO
}  // end of Kif::Win32
}  // end of Kif

